package ch10.d2;

import org.junit.Test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamTest {

    @Test
    public void testWrite() throws IOException {
        FileOutputStream fos=new FileOutputStream("javak108.txt");
        fos.write(97);
        fos.write(98);
        fos.close();
    }

    @Test
    public void testWrite2() throws IOException {
        FileOutputStream fos=new FileOutputStream("javak108.txt",true);
        //罗俊杰 9个字节
        byte[] b="\n赵英崭".getBytes();
        fos.write(b);
        fos.close();
    }
}
